#!/bin/bash
##################################################################
# File: save_checkpoint.sh
# Co: The Neurosciences Institute
# Author: Richard G. Martin
# Purpose: Save checkpoint files to a target directory.
#################################################################

LABEL=$1 #read in time argument for new directory name
target_dir=${LABEL} 
echo Saving Checkpoint: $target_dir . . . 
mkdir $target_dir

#Copy Files to target directory
mv groups.dat $target_dir/.
mv patternhist.dat $target_dir/.
mv spikes* $target_dir/.
mv *.dyn $target_dir/.
cp circuits.mat $target_dir/.
mv motorcommands.dat $target_dir/.
cp *world.h $target_dir/.
mv DA_debugger.dat $target_dir/.
mv button_timings.dat $target_dir/.

#matlab -nodisplay -nodesktop -r time_and_score > score.txt

mv score.txt $target_dir/.

rm *.syn
rm *.bra
rm connect*
